<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>:nth-child(n)选择器和:nth-last-child(n)选择器</title>
    <style type="text/css">
        p:nth-child(2){
            color:pink;
            font-size:16px;
            font-family:"宋体";
        }
        p:nth-last-child(2){
            color:blue;
            font-size:16px;
            font-family:"微软雅黑";
        }
    </style>
</head>
<body>
    <div>
        <p>第一篇 毕业了</p>
        <p>第二篇 关于考试</p>
        <p>第三篇 夏日飞舞</p>
        <p>第四篇 惆怅的心</p>
        <p>第五篇 畅谈美丽</p>
    </div>
</body>
</html>
    
    
    
    
    